<%- include('header') %>
<head>
    <link href="/stylesheets/style.css" rel="stylesheet">
    <link rel="stylesheet" href="/stylesheets/main.css" />
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=<%=ak%>"></script>
</head>
<div id="wrapper">
    <div id="sidebar">
        <p>
            <a id="doupd" class="btn-primary btn-sm btn-success" href="javascript:TimerOn();">开始更新</a>
            <a id="noupd" class="btn-primary btn-sm btn-danger" href="javascript:TimerOff();">停止更新</a>
        </p>
        <% for (let i=0; i<marker_cnt; i++) { ii=i+1; %>
            <div class='card'>
                <div class='card-header'>
                    <span>第<%=ii%>组</span>
                    <span><a id="btnHide<%=i%>" class="btn-primary btn-sm"
                            href="javascript:hideMarker(<%=i%>);">隐藏</a></span>
                    <span><a id="btnShow<%=i%>" style="display:none" class="btn-secondary btn-sm"
                            href="javascript:showMarker(<%=i%>);">显示</a></span>
                </div>
                <div class='card-body'><span class="alt" id="marker_desc<%=i%>">暂无数据</span></div>
            </div>
        <% } %>
    </div>
    <div id="swbutton" onclick="switch_sidebar()"><span>&lt;</span></div>
    <div id="container">
        <h4 id="container_info">请稍等，正在加载地图……</h4>
    </div>
    <script async type="text/javascript" src="/javascripts/mapctl.js"></script>
</div>
<% if (show_sim) {%>
<div id="simulator">
    <script src="javascripts/sim.js"></script>
    <div id="simulator-head">
        <span>发送模拟器</span>
        <div>
            <a href="javascript:simSend()" class="btn btn-primary btn-sm">发送</a>
            <a href="javascript:$('#simulator').hide()" class="btn btn-danger btn-sm">X</a>
        </div>
    </div>
    <div id="simulator-body">
        <table>
            <tr>
                <td>编号</td>
                <td><input id="sim-upd-id" type="text" value="1" /></td>
            </tr>
            <tr>
                <td>内容</td>
                <td><input id="sim-upd-content" type="text"
                        value="32.1,N,118.8,E,100.0,M,101352,P,1.00,2.00,3.00,1.00,2.00,3.000,S" /></td>
            </tr>
        </table>
    </div>
    <div id="simulator-info">
        <span id="info-content"></span>
    </div>
</div>
<%}%>
<%- include('footer') %>